<template>
  <section>
    <el-card class="box-card">
      <div slot="header"
           v-if="title && !hiddenHeader"
           class="header">
        <div class="title"
             v-html="title"></div>
        <div class="right">
          <slot name="header-right" />
        </div>
      </div>
      <slot />
    </el-card>
  </section>
</template>
<script>
export default {
  name: 'ym-card',
  props: {
    title: {
      type: String,
      default: ""
    },
    hiddenHeader: {
      type: Boolean,
      default: false
    }
  },
  mounted () {
    this.$emit('load')
  }
}
</script>
<style lang="scss" scoped>
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  .title {
    display: flex;
    align-items: center;
  }
  .right {
    display: flex;
    align-items: center;
  }
}
/deep/.el-card__header {
  padding: 0px 10px;
  line-height: 40px;
  font-size: 14px;
}
</style>
